package 力扣._8048_最大二进制奇数;

public class Solution {
    public String maximumOddBinaryNumber(String s) {
        int sum_0 = 0, sum_1 = 0;
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) == '1')
                sum_1++;
            else
                sum_0++;
        }
        String r = "";
        if (sum_1 > 1)
            r += "1".repeat(sum_1 - 1);
        r += "0".repeat(sum_0);
        if (sum_1 > 0)
            r += "1";
        return r;
    }
}
